﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleActor
{
    /// <summary>
    /// Represents an actor servant.
    /// </summary>
    public interface IActorServant
    {
        /// <summary>
        /// Sets the message handler.
        /// </summary>
        /// <remarks>
        /// This method is invoked before <see cref="OnStart"/>
        /// </remarks>
        /// <param name="handler">The message handler.</param>
        void SetMessageHandler(IMessageHandler handler);

        /// <summary>
        /// Invoked when the actor thread is starting.
        /// </summary>
        void OnStart();
        
        /// <summary>
        /// Represents the main action of actor thread.
        /// </summary>
        void Run();

        /// <summary>
        /// Invoked when the actor thread is stopping.
        /// </summary>
        void OnStop();
    }
}
